<?php
	$path_one = 'admin/admin_system';
	$path_two = 'admin/boss';
	$filename = 'admin/boss_cash';
	require_once("header.php");
	require_once("admin_comm.php");
	$boss_object=new boss();
	$page=request('page',false,true,false,1);
	$pagesize=request('pagesize',false,true,false,10);
	$data['uid']=request('uid',false,true,false,0);	
	$data['type']=request('type',false,true,false,0);
	$result = $boss_object->cash_search($data,$page,$pagesize,'*');
	$hover[$data['type']]=' class="hover" ';

	$boss_rtn=$boss_object->boss_rtn();
	
	$query_str=http_build_query($data);
	$typedata=$data;
	unset($typedata['type']);
	$query_strtype=http_build_query($typedata);
?>
<script type="text/javascript" charset="utf-8">
	loader.file({
		plugin:['validform/main','dialog/main'],
		skincss:['list']
	})	
</script>
</head>
<body>
	<div class="position_nav">你所在的当前位置：<?php echo $path_str;?></div>
		<div class="main">

			<div class="sos_box">
				<form action="/admin/boss_cash" id="search" method='get'>
				    <input type="hidden" name="pid" id='pid' value="<?php echo $data['pid'] ;?>">
					<span>设备老板：</span>
					<select name='uid'>
					 <option value="">全部</option>
					 <?php 
					   if($boss_rtn){
                         foreach($boss_rtn as $val){
					 ?>
					   <option value="<?php echo $val['id'];?>" <?php echo $val['id']==$data['uid']?'selected':'';?>><?php echo $val['name']?></option>
					 <?php 
					   }}
					 ?>                          					 
					</select>				    					
					<input class="button1" type="submit" value="搜索">
				</form>
			</div>
			<div class="power_nav">
				<ul>
					<li <?php echo $hover[0] ;?>>
						<a href="?type=0&<?php echo $query_strtype;?>">全部</a>
					</li>
					<li <?php echo $hover[1] ;?>>
						<a href="?type=1&<?php echo $query_strtype;?>">已处理</a>
					</li>
					<li<?php echo $hover[2] ;?>>
						<a href="?type=2&<?php echo $query_strtype;?>">待处理</a>
					</li>									
				</ul>
			</div>
			<table cellpadding="0" cellspacing="1" border="0" class="table">
				<tr>
					<th align="center">序号</th>
					<th align="left">设备老板</th>
					<th align="left">充值金额</th>
					<th align="left">时间</th>
					<th align="left">延长时间</th>									
					<th align="center">状态</th>					
					<th align="center">操作</th>
				</tr>
				<?php
					if($result['rows']){                                               
						foreach ($result['rows'] as $v){
                             $bossinfo=$boss_rtn[$v['uid']];
							?>
							<tr>
								<td align="center"><?php echo $v['id'] ;?></td>
								<td align="left"><?php echo $bossinfo['name'];?></td>
								<td align="left"><?php echo $v['money'] ;?></td>
								<td align="left"><?php echo $v['time']?date('Y-m-d H:i:s',$v['time']):'';?></td>
								<td align="left"><?php echo $v['length']/86400 ;?>天</td>															
								<td align="center"><?php echo 1==$v['state']?'已处理':'<font color="red">待处理</font>';?></td>								
								<td align="center">
								    <a href="/admin/boss_cash_edit?id=<?php echo $v['carid'];?>">查看</a>								    
								</td>
							</tr>
							<?php
						}
					}else{
						?>
						<tr>
							<td colspan="7">暂无数据！</td>
						</tr>
						<?php
					}
					if($result['page_count']>1){
				?>
				<tr>
					<td colspan="8">
						<div class="list_more">
							总数：<?php echo $result['row_count']?$result['row_count']:0 ;?>
							<?php
								echo page_method($result['row_count'], $page, $result['page_count'], 10, '/admin/boss_cash?'.$query_str, false);
							?>
						</div>
					</td>
				</tr>
				<?php 
				 }
				?>
			</table>
		</div>
	</div>
</body>
</html>


